package com.example.qxfw.nyqx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.ny.QhYzDisppara;
import com.example.qxfw.nyqx.mapper.QhYzDispparaMapper;
import com.example.qxfw.nyqx.service.QhYzDispparaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QhYzDispparaServiceImpl implements QhYzDispparaService {

    @Autowired
    private QhYzDispparaMapper qhYzDispparaMapper;

    @Override
    public List<QhYzDisppara> getList(String factorIndex) {
        return qhYzDispparaMapper.selectList(Wrappers.<QhYzDisppara>lambdaQuery().eq(QhYzDisppara::getFactorindex,factorIndex));
    }

    @Override
    public Integer save(QhYzDisppara qhYzDisppara) {
        return qhYzDispparaMapper.insert(qhYzDisppara);
    }

    @Override
    public Integer delete(String id) {
        return qhYzDispparaMapper.deleteById(id);
    }

    @Override
    public Integer update(QhYzDisppara qhYzDisppara) {
        return qhYzDispparaMapper.update(qhYzDisppara, Wrappers.<QhYzDisppara>lambdaUpdate().eq(QhYzDisppara::getId,qhYzDisppara.getId()));
    }
}
